import antfu from '@antfu/eslint-config'

export default antfu(
  {
    markdown: false,
  },
  {
    rules: {
      'no-console': 0,
      'no-debugger': 0,
      'no-alert': 0,
      'no-lone-blocks': 0,
      'no-restricted-syntax': 0,
      'no-cond-assign': 0,
      'no-sparse-arrays': 0,
      'no-sequences': 0,
      'no-unused-expressions': 0,
      'no-template-curly-in-string': 0,
      'ts/no-namespace': 0,
      'ts/ban-types': 0,

      'unused-imports/no-unused-imports': 'error',
      'unused-imports/no-unused-vars': [
        'error',
        {
          vars: 'all',
          caughtErrors: 'all',
        },
      ],

      'ts/no-use-before-define': 0,
      '@typescript-eslint/no-unused-expressions': 0,
      '@typescript-eslint/no-empty-object-type': 0,
      '@typescript-eslint/consistent-type-definitions': 0,

      'vue/eqeqeq': 0,
      'vue/block-order': 0,
      'vue/define-macros-order': 0,
      'vue/no-template-shadow': 0,
      'vue/quote-props': 0,
      'vue/html-self-closing': 0,
      'vue/brace-style': 0,

      'regexp/no-useless-assertions': 0,
      'regexp/no-super-linear-backtracking': 0,

      'antfu/top-level-function': 0,
      curly: 0,
      eqeqeq: 0,
      'new-cap': 0,

      'style/spaced-comment': [
        'error',
        'always',
        {
          block: {
            balanced: true,
            exceptions: ['*'],
            markers: ['!'],
          },
          line: {
            exceptions: ['/'],
            markers: ['/', '#', '//', '$', '?', '|'],
          },
        },
      ],

      'max-len': ['error', 100],
    },
  },
  {
    ignores: [
      '**/tsconfig.json',
      '**/tsconfig.node.json',
      '**/package.json',
      'packages/expresso-plus/tsconfig.json',
      'pnpm-workspace.yaml',
      'node_modules/**',
    ],
  },
)
